﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EQual.MainModule.Projects.Models
{
    public class ProjectsPresentationModel : EQual.Infrastructure.MVPFramework.Models.PresentationModelBase<DataAccesLayer.Project >,IProjectsPresentationModel
    {
        public ProjectsPresentationModel()
        {
            this.DataFactory = new DataAccesLayer.EQualDataLayerFactory();
        }

        protected override IEnumerable<DataAccesLayer.Project> GetCollection()
        {
            return this.DataFactory.GetProjectsAccesLayer().GetProjects() as IEnumerable<DataAccesLayer.Project>;
        }

        protected override void CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            base.CollectionChanged(sender, e);
        }

        #region IProjectsPresentationModel Members

        public new System.Collections.IEnumerable ItemsCollection
        {
            get { return base.ItemsCollection; }
        }

        public string HeaderInfo
        {
            get;
            set;
        }

        public EQual.MainModule.Projects .Views .IProjectsGridView   View
        {
            get;
            set;

        }

        object _project;
        public object ActiveItem
        {
            get { return _project; }

            set
            {
                _project = value;
                InvokePropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("ActiveItem"));
            }
        }

        #endregion
    }
}
